#include "fig_miniboss_meganito.h"
#include "fig_enemybullet_master.h"
#include "fighter.h"

#include "num/rand.h"
#include "math/facing.h"



FIGMiniBossMeganito::FIGMiniBossMeganito(FIGEnemyCraft::ENEMY_TYPES EnemyType) : 
							FIGEnemyMiniBoss(										
										EnemyType
										)
{
	
	m_Accel = 1.0f;	
	m_MaxAttackCount = 6;
}





void			FIGMiniBossMeganito::OnShootStyle1()
{
											
	FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(0),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_RED,
											FIGBullet::SHOOT_STYLES_DOUBLE,
											180,		// degree
											0,
											false,
											NULL
          									);

	FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(1),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_RED,
											FIGBullet::SHOOT_STYLES_DOUBLE,
											-45+180,		// degree
											0,
											false,
											NULL
          									);


	FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(2),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_RED,
											FIGBullet::SHOOT_STYLES_DOUBLE,
											45+180,		// degree
											0,
											false,
											NULL
          									);


}

void			FIGMiniBossMeganito::OnShootStyle2()
{
	FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(0),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_RED,
											FIGBullet::SHOOT_STYLES_DOUBLE,
											0,		// degree
											0,		// delay
											true,		// shoot to player
											NULL
          									);

	FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(0),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_RED,
											FIGBullet::SHOOT_STYLES_DOUBLE,
											0,		// degree
											0.2f,		// delay
											true,
											NULL
          									);

	FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(1),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_RED,
											FIGBullet::SHOOT_STYLES_DOUBLE,
											90,		// degree
											0.0f,		// delay
											false,
											NULL
          									);


	FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(2),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_RED,
											FIGBullet::SHOOT_STYLES_DOUBLE,
											-90,		// degree
											0.0f,		// delay
											false,
											NULL
          									);
}

void		FIGMiniBossMeganito::Tick_RotateBack(float dt)
{
	m_MiniBossState = MINIBOSS_STATE_GOBACK;
	m_Speed = 0.0f;
}

void		FIGMiniBossMeganito::Tick_GoBack(float dt)
{
	m_Speed += dt;
	if(m_Speed > 0.5f)
		m_Speed = 0.5f;
	FIGEnemyMiniBoss::Tick_GoBack(dt);

}